#pragma once

#include "../Maps/TerrainType.h"
#include "../Math/Vec3f.h"
#include "../Math/Vec2i.h"
#include <memory>
#include <vector>

class GameObject;
typedef std::shared_ptr<GameObject> GameObjectPtr;

class Cell
{
public:
	Cell(const Vec3f &pos, float slope);
	~Cell();

	void render();

	const Vec3f &getPos() const { return pos; }
	const Vec2i &getPos2d() const { return pos2d; }
	bool isWalkable() const { return walkable; }
	void setWalkable(bool flag) { walkable = flag; }
	const TerrainTypePtr &getTerrainType() const { return terrainType; }

	void addGameObject(const GameObjectPtr &gameObject) { gameObjects.push_back(gameObject); }
	const std::vector<GameObjectPtr> &getGameObjects() const { return gameObjects; }

private:
	Vec3f pos;
	Vec2i pos2d;
	bool walkable;

	TerrainTypePtr terrainType;
	std::vector<GameObjectPtr> gameObjects;
};
typedef std::shared_ptr<Cell> CellPtr;
